<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 0-99
        var r = parseInt(Math.random() * 100)
        console.log(r);

        var arr = [1, 2, 3, 4];

        // join --for 循环变量    reduce   map
        arr.join('');
        var res = ''
        for (var i = 0; i < arr.length; i++) {
            res = res + arr[i]
        }

        var res2 = arr.reduce(function (sum, v) {
            return sum + v;
        }, '');

        var arr2 = [{ name: 'zhangsan' }, { name: 'lisi' }];
        var res = ''
        for (var i = 0; i < arr2.length; i++) {
            res = res + arr[i].name
        }

        var res2 = arr2.reduce(function (sum, v) {
            return sum + v.name;
        }, '');

        var arr3 = arr2.map(function (v) {
            return v.name
        });
        //['zhangsan','lisi']
        arr3.join("")



    </script>

</body>

</html>